<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class Gass_conf extends CI_Controller {
    function __construct() 
    {
        parent::__construct();
		
		// To load the CI benchmark and memory usage profiler - set 1==1.
		if (1==2) 
		{
			$sections = array(
				'benchmarks' => TRUE, 'memory_usage' => TRUE, 
				'config' => FALSE, 'controller_info' => FALSE, 'get' => FALSE, 'post' => FALSE, 'queries' => FALSE, 
				'uri_string' => FALSE, 'http_headers' => FALSE, 'session_data' => FALSE
			); 
			$this->output->set_profiler_sections($sections);
			$this->output->enable_profiler(TRUE);
		}
		
		// Load required CI libraries and helpers.
		$this->load->database();
		$this->load->library('session');
 		$this->load->helper('url');
 		$this->load->helper('form');

  		// IMPORTANT! This global must be defined BEFORE the flexi auth library is loaded! 
 		// It is used as a global that is accessible via both models and both libraries, without it, flexi auth will not work.
		$this->auth = new stdClass;
		
		// Load 'standard' flexi auth library by default.
		$this->load->library('flexi_auth');	
		
		// Note: This is only included to create base urls for purposes of this demo only and are not necessarily considered as 'Best practice'.
		$this->load->vars('base_url', $this->config->item('base_url'));
		$this->load->vars('includes_dir', $this->config->item('includes_dir'));
		$this->load->vars('current_url', $this->uri->uri_to_assoc(1));
		
		// Define a global variable to store data that is then used by the end view page.
		$this->data = null;
		//$this->output->enable_profiler(TRUE);
	}
	/**
	 * 对配置文件的内容进行更新，目前仅实现普通的转换更新
	 */ 	
	function gass_config_edit(){
		$filePath = $this->config->item('includes_dir').'/132.xml';
		$xml_array=simplexml_load_file($filePath); //将XML中的数据,读取到数组对象中 
    var_dump($xml_array->Information->Record);
    //foreach($xml_array->Information as $tmp){ 
    //  var_dump($tmp->YXSDM);
    //} 
		$this->load->view('xml_conf_view', $this->data);
	}
}